#!/usr/bin/env ruby

LKP_SRC = ENV['LKP_SRC'] || File.dirname(File.dirname(File.realpath($PROGRAM_NAME)))
require "#{LKP_SRC}/lib/tests/stats"

stats = LKP::Stats.new

while (line = $stdin.gets)
  case line
  when /^mce-log-item:(\S+)$/
    item = $1
  when /^(\S+)\.conf: triggers trigger as expected$/
    stats["#{item}.#{$1}"] = 'pass'
  when /^(\S+)\.conf: triggers did not trigger as expected:/
    stats["#{item}.#{$1}"] = 'fail'
  when /^(ignored_by_lkp): (.*)/
    stats[$2] = 'skip'
  end
end

stats.dump
